home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Tools - Objects / Virtual User 1.0 / Example Scripts / MessagePassing Example / Actor1.vu next >
Text File  |  1991-01-25  |  2KB  |  49 lines

  1. #
  2. #    File:        actor1.vu
  3. #
  4. #    Contains:    This is a demo script which runs in parallel with the script
  5. #                actor2.vu. They together demonstrate message passing while 
  6. #                sharing tasks in a library. To run this demo you need two 
  7. #                target machines (both having the Desk Accessory, Key Caps).
  8. #                It would be better if the two targets had different memory
  9. #                configurations and are running different versions of system software.
  10. #                Your command line should be as follows: (assuming the two 
  11. #                targets have user names as Target1 and Target2 and that
  12. #                Actor1.vu, Actor2.vu and the library MessagePassingDemoLib.vu
  13. #                are all in your current working directory)
  14. #                VU    -t1 '*:Target1' -s1 Actor1.vu -l1 Actor1.log ∂
  15. #                    -t2 '*:Target2' -s2 Actor2.vu -l2 Actor2.log
  16. #
  17. #    Caution:    Do not forget to turn the key repeat off in the control panel on both
  18. #                the targets. The script takes a few seconds before you start seeing
  19. #                anything on the target screens.
  20. #
  21. #    Written by:    P Nagarajan
  22. #
  23. #    Copyright:    © 1990 by Apple Computer, Inc., all rights reserved.
  24. #
  25. #    Change History:
  26. #
  27. #        8/16/90       naga         creation 
  28. #
  29. #    To Do:
  30. #
  31.  
  32. Libraries    "MessagePassingDemoLib.vu";
  33.  
  34. actorName("Actor1");#set name for self to Actor1, the main actor
  35. other_actors := {};
  36. wait(2);#wait is required to make sure that the other actor(s)
  37.         #have finished changing their names before we do a collect
  38. all_actors := collect[actor];
  39. for each a in all_actors
  40. begin
  41.     if a.t <> "Actor1"
  42.         other_actors := other_actors + {a};
  43. end;#for each
  44. #remove self from all actors list
  45. open_session(other_actors[1]); #pick the first actor and open a session
  46. send(other_actors[1], {"Start"});
  47. run_demo(other_actors[1]);
  48. closeSession(other_actors[1]);
  49.